home *** CD-ROM | disk | FTP | other *** search
/ SGI Freeware 1999 August / SGI Freeware 1999 August.iso / dist / fw_cvs.idb / usr / freeware / info / cvsclient.info-2.z / cvsclient.info-2
Encoding:
GNU Info File  |  1999-04-16  |  46.4 KB  |  1,001 lines

  1. This is Info file cvsclient.info, produced by Makeinfo version 1.67
  2. from the input file ./cvsclient.texi.
  3.  
  4. 
  5. File: cvsclient.info,  Node: Requests,  Next: Response intro,  Prev: Request intro,  Up: Protocol
  6.  
  7. Requests
  8. ========
  9.  
  10.    Here are the requests:
  11.  
  12. `Root PATHNAME \n'
  13.      Response expected: no.  Tell the server which `CVSROOT' to use.
  14.      Note that PATHNAME is a local directory and *not* a fully
  15.      qualified `CVSROOT' variable.  PATHNAME must already exist; if
  16.      creating a new root, use the `init' request, not `Root'.  PATHNAME
  17.      does not include the hostname of the server, how to access the
  18.      server, etc.; by the time the CVS protocol is in use, connection,
  19.      authentication, etc., are already taken care of.
  20.  
  21.      The `Root' request must be sent only once, and it must be sent
  22.      before any requests other than `Valid-responses',
  23.      `valid-requests', `UseUnchanged', or `init'.
  24.  
  25. `Valid-responses REQUEST-LIST \n'
  26.      Response expected: no.  Tell the server what responses the client
  27.      will accept.  request-list is a space separated list of tokens.
  28.  
  29. `valid-requests \n'
  30.      Response expected: yes.  Ask the server to send back a
  31.      `Valid-requests' response.
  32.  
  33. `Directory LOCAL-DIRECTORY \n'
  34.      Additional data: REPOSITORY \n.  Response expected: no.  Tell the
  35.      server what directory to use.  The REPOSITORY should be a
  36.      directory name from a previous server response.  Note that this
  37.      both gives a default for `Entry' and `Modified' and also for `ci'
  38.      and the other commands; normal usage is to send `Directory' for
  39.      each directory in which there will be an `Entry' or `Modified',
  40.      and then a final `Directory' for the original directory, then the
  41.      command.  The LOCAL-DIRECTORY is relative to the top level at
  42.      which the command is occurring (i.e. the last `Directory' which is
  43.      sent before the command); to indicate that top level, `.' should
  44.      be sent for LOCAL-DIRECTORY.
  45.  
  46.      Here is an example of where a client gets REPOSITORY and
  47.      LOCAL-DIRECTORY.  Suppose that there is a module defined by
  48.  
  49.           moddir 1dir
  50.  
  51.      That is, one can check out `moddir' and it will take `1dir' in the
  52.      repository and check it out to `moddir' in the working directory.
  53.      Then an initial check out could proceed like this:
  54.  
  55.           C: Root /home/kingdon/zwork/cvsroot
  56.           . . .
  57.           C: Argument moddir
  58.           C: Directory .
  59.           C: /home/kingdon/zwork/cvsroot
  60.           C: co
  61.           S: Clear-sticky moddir/
  62.           S: /home/kingdon/zwork/cvsroot/1dir/
  63.           . . .
  64.           S: ok
  65.  
  66.      In this example the response shown is `Clear-sticky', but it could
  67.      be another response instead.  Note that it returns two pathnames.
  68.      The first one, `moddir/', indicates the working directory to check
  69.      out into.  The second one, ending in `1dir/', indicates the
  70.      directory to pass back to the server in a subsequent `Directory'
  71.      request.  For example, a subsequent `update' request might look
  72.      like:
  73.  
  74.           C: Directory moddir
  75.           C: /home/kingdon/zwork/cvsroot/1dir
  76.           . . .
  77.           C: update
  78.  
  79.      For a given LOCAL-DIRECTORY, the repository will be the same for
  80.      each of the responses, so one can use the repository from whichever
  81.      response is most convenient.  Typically a client will store the
  82.      repository along with the sources for each LOCAL-DIRECTORY, use
  83.      that same setting whenever operating on that LOCAL-DIRECTORY, and
  84.      not update the setting as long as the LOCAL-DIRECTORY exists.
  85.  
  86.      A client is free to rename a LOCAL-DIRECTORY at any time (for
  87.      example, in response to an explicit user request).  While it is
  88.      true that the server supplies a LOCAL-DIRECTORY to the client, as
  89.      noted above, this is only the default place to put the directory.
  90.      Of course, the various `Directory' requests for a single command
  91.      (for example, `update' or `ci' request) should name a particular
  92.      directory with the same LOCAL-DIRECTORY.
  93.  
  94.      Each `Directory' request specifies a brand-new LOCAL-DIRECTORY and
  95.      REPOSITORY; that is, LOCAL-DIRECTORY and REPOSITORY are never
  96.      relative to paths specified in any previous `Directory' request.
  97.  
  98. `Max-dotdot LEVEL \n'
  99.      Response expected: no.  Tell the server that LEVEL levels of
  100.      directories above the directory which `Directory' requests are
  101.      relative to will be needed.  For example, if the client is
  102.      planning to use a `Directory' request for `../../foo', it must
  103.      send a `Max-dotdot' request with a LEVEL of at least 2.
  104.      `Max-dotdot' must be sent before the first `Directory' request.
  105.  
  106. `Static-directory \n'
  107.      Response expected: no.  Tell the server that the directory most
  108.      recently specified with `Directory' should not have additional
  109.      files checked out unless explicitly requested.  The client sends
  110.      this if the `Entries.Static' flag is set, which is controlled by
  111.      the `Set-static-directory' and `Clear-static-directory' responses.
  112.  
  113. `Sticky TAGSPEC \n'
  114.      Response expected: no.  Tell the server that the directory most
  115.      recently specified with `Directory' has a sticky tag or date
  116.      TAGSPEC.  The first character of TAGSPEC is `T' for a tag, or `D'
  117.      for a date.  The remainder of TAGSPEC contains the actual tag or
  118.      date.
  119.  
  120.      The server should remember `Static-directory' and `Sticky'
  121.      requests for a particular directory; the client need not resend
  122.      them each time it sends a `Directory' request for a given
  123.      directory.  However, the server is not obliged to remember them
  124.      beyond the context of a single command.
  125.  
  126. `Checkin-prog PROGRAM \n'
  127.      Response expected: no.  Tell the server that the directory most
  128.      recently specified with `Directory' has a checkin program PROGRAM.
  129.      Such a program would have been previously set with the
  130.      `Set-checkin-prog' response.
  131.  
  132. `Update-prog PROGRAM \n'
  133.      Response expected: no.  Tell the server that the directory most
  134.      recently specified with `Directory' has an update program PROGRAM.
  135.      Such a program would have been previously set with the
  136.      `Set-update-prog' response.
  137.  
  138. `Entry ENTRY-LINE \n'
  139.      Response expected: no.  Tell the server what version of a file is
  140.      on the local machine.  The name in ENTRY-LINE is a name relative
  141.      to the directory most recently specified with `Directory'.  If the
  142.      user is operating on only some files in a directory, `Entry'
  143.      requests for only those files need be included.  If an `Entry'
  144.      request is sent without `Modified', `Is-modified', or `Unchanged',
  145.      it means the file is lost (does not exist in the working
  146.      directory).  If both `Entry' and one of `Modified', `Is-modified',
  147.      or `Unchanged' are sent for the same file, `Entry' must be sent
  148.      first.  For a given file, one can send `Modified', `Is-modified',
  149.      or `Unchanged', but not more than one of these three.
  150.  
  151. `Kopt OPTION \n'
  152.      This indicates to the server which keyword expansion options to
  153.      use for the file specified by the next `Modified' or `Is-modified'
  154.      request (for example `-kb' for a binary file).  This is similar to
  155.      `Entry', but is used for a file for which there is no entries line.
  156.      Typically this will be a file being added via an `add' or `import'
  157.      request.  The client may not send both `Kopt' and `Entry' for the
  158.      same file.
  159.  
  160. `Modified FILENAME \n'
  161.      Response expected: no.  Additional data: mode, \n, file
  162.      transmission.  Send the server a copy of one locally modified
  163.      file.  FILENAME is relative to the most recent repository sent
  164.      with `Directory'.  If the user is operating on only some files in
  165.      a directory, only those files need to be included.  This can also
  166.      be sent without `Entry', if there is no entry for the file.
  167.  
  168. `Is-modified FILENAME \n'
  169.      Response expected: no.  Additional data: none.  Like `Modified',
  170.      but used if the server only needs to know whether the file is
  171.      modified, not the contents.
  172.  
  173.      The commands which can take `Is-modified' instead of `Modified'
  174.      with no known change in behavior are: `admin', `diff' (if and only
  175.      if two `-r' or `-D' options are specified), `watch-on',
  176.      `watch-off', `watch-add', `watch-remove', `watchers', `editors',
  177.      `log', and `annotate'.
  178.  
  179.      For the `status' command, one can send `Is-modified' but if the
  180.      client is using imperfect mechanisms such as timestamps to
  181.      determine whether to consider a file modified, then the behavior
  182.      will be different.  That is, if one sends `Modified', then the
  183.      server will actually compare the contents of the file sent and the
  184.      one it derives from to determine whether the file is genuinely
  185.      modified.  But if one sends `Is-modified', then the server takes
  186.      the client's word for it.  A similar situation exists for `tag',
  187.      if the `-c' option is specified.
  188.  
  189.      Commands for which `Modified' is necessary are `co', `ci',
  190.      `update', and `import'.
  191.  
  192.      Commands which do not need to inform the server about a working
  193.      directory, and thus should not be sending either `Modified' or
  194.      `Is-modified': `rdiff', `rtag', `history', `init', and `release'.
  195.  
  196.      Commands for which further investigation is warranted are:
  197.      `remove', `add', and `export'.  Pending such investigation, the
  198.      more conservative course of action is to stick to `Modified'.
  199.  
  200. `Unchanged FILENAME \n'
  201.      Response expected: no.  Tell the server that FILENAME has not been
  202.      modified in the checked out directory.  The name is relative to
  203.      the most recent repository sent with `Directory'.
  204.  
  205. `UseUnchanged \n'
  206.      Response expected: no.  To specify the version of the protocol
  207.      described in this document, servers must support this request
  208.      (although it need not do anything) and clients must issue it.
  209.  
  210. `Notify FILENAME \n'
  211.      Response expected: no.  Tell the server that a `edit' or `unedit'
  212.      command has taken place.  The server needs to send a `Notified'
  213.      response, but such response is deferred until the next time that
  214.      the server is sending responses.  Response expected: no.
  215.      Additional data:
  216.           NOTIFICATION-TYPE \t TIME \t CLIENTHOST \t
  217.           WORKING-DIR \t WATCHES \n
  218.      where NOTIFICATION-TYPE is `E' for edit, `U' for unedit, undefined
  219.      behavior if `C', and all other letters should be silently ignored
  220.      for future expansion.  TIME is the time at which the edit or
  221.      unedit took place, in a user-readable format of the client's
  222.      choice (the server should treat the time as an opaque string
  223.      rather than interpreting it).  CLIENTHOST is the name of the host
  224.      on which the edit or unedit took place, and WORKING-DIR is the
  225.      pathname of the working directory where the edit or unedit took
  226.      place.  WATCHES are the temporary watches to set.  If WATCHES is
  227.      followed by \t then the \t and the rest of the line should be
  228.      ignored, for future expansion.
  229.  
  230.      Note that a client may be capable of performing an `edit' or
  231.      `unedit' operation without connecting to the server at that time,
  232.      and instead connecting to the server when it is convenient (for
  233.      example, when a laptop is on the net again) to send the `Notify'
  234.      requests.  Even if a client is capable of deferring notifications,
  235.      it should attempt to send them immediately (one can send `Notify'
  236.      requests together with a `noop' request, for example), unless
  237.      perhaps if it can know that a connection would be impossible.
  238.  
  239. `Questionable FILENAME \n'
  240.      Response expected: no.  Additional data: no.  Tell the server to
  241.      check whether FILENAME should be ignored, and if not, next time the
  242.      server sends responses, send (in a `M' response) `?' followed by
  243.      the directory and filename.  FILENAME must not contain `/'; it
  244.      needs to be a file in the directory named by the most recent
  245.      `Directory' request.
  246.  
  247. `Case \n'
  248.      Response expected: no.  Tell the server that filenames should be
  249.      matched in a case-insensitive fashion.  Note that this is not the
  250.      primary mechanism for achieving case-insensitivity; for the most
  251.      part the client keeps track of the case which the server wants to
  252.      use and takes care to always use that case regardless of what the
  253.      user specifies.  For example the filenames given in `Entry' and
  254.      `Modified' requests for the same file must match in case
  255.      regardless of whether the `Case' request is sent.  The latter
  256.      mechanism is more general (it could also be used for 8.3
  257.      filenames, VMS filenames with more than one `.', and any other
  258.      situation in which there is a predictable mapping between
  259.      filenames in the working directory and filenames in the protocol),
  260.      but there are some situations it cannot handle (ignore patterns, or
  261.      situations where the user specifies a filename and the client does
  262.      not know about that file).
  263.  
  264. `Argument TEXT \n'
  265.      Response expected: no.  Save argument for use in a subsequent
  266.      command.  Arguments accumulate until an argument-using command is
  267.      given, at which point they are forgotten.
  268.  
  269. `Argumentx TEXT \n'
  270.      Response expected: no.  Append \n followed by text to the current
  271.      argument being saved.
  272.  
  273. `Global_option OPTION \n'
  274.      Response expected: no.  Transmit one of the global options `-q',
  275.      `-Q', `-l', `-t', `-r', or `-n'.  OPTION must be one of those
  276.      strings, no variations (such as combining of options) are allowed.
  277.      For graceful handling of `valid-requests', it is probably better
  278.      to make new global options separate requests, rather than trying
  279.      to add them to this request.
  280.  
  281. `Gzip-stream LEVEL \n'
  282.      Response expected: no.  Use zlib (RFC 1950/1951) compression to
  283.      compress all further communication between the client and the
  284.      server.  After this request is sent, all further communication
  285.      must be compressed.  All further data received from the server
  286.      will also be compressed.  The LEVEL argument suggests to the
  287.      server the level of compression that it should apply; it should be
  288.      an integer between 1 and 9, inclusive, where a higher number
  289.      indicates more compression.
  290.  
  291. `Kerberos-encrypt \n'
  292.      Response expected: no.  Use Kerberos encryption to encrypt all
  293.      further communication between the client and the server.  This
  294.      will only work if the connection was made over Kerberos in the
  295.      first place.  If both the `Gzip-stream' and the `Kerberos-encrypt'
  296.      requests are used, the `Kerberos-encrypt' request should be used
  297.      first.  This will make the client and server encrypt the
  298.      compressed data, as opposed to compressing the encrypted data.
  299.      Encrypted data is generally incompressible.
  300.  
  301.      Note that this request does not fully prevent an attacker from
  302.      hijacking the connection, in the sense that it does not prevent
  303.      hijacking the connection between the initial authentication and the
  304.      `Kerberos-encrypt' request.
  305.  
  306. `Gssapi-encrypt \n'
  307.      Response expected: no.  Use GSSAPI encryption to encrypt all
  308.      further communication between the client and the server.  This
  309.      will only work if the connection was made over GSSAPI in the first
  310.      place.  See `Kerberos-encrypt', above, for the relation between
  311.      `Gssapi-encrypt' and `Gzip-stream'.
  312.  
  313.      Note that this request does not fully prevent an attacker from
  314.      hijacking the connection, in the sense that it does not prevent
  315.      hijacking the connection between the initial authentication and the
  316.      `Gssapi-encrypt' request.
  317.  
  318. `Gssapi-authenticate \n'
  319.      Response expected: no.  Use GSSAPI authentication to authenticate
  320.      all further communication between the client and the server.  This
  321.      will only work if the connection was made over GSSAPI in the first
  322.      place.  Encrypted data is automatically authenticated, so using
  323.      both `Gssapi-authenticate' and `Gssapi-encrypt' has no effect
  324.      beyond that of `Gssapi-encrypt'.  Unlike encrypted data, it is
  325.      reasonable to compress authenticated data.
  326.  
  327.      Note that this request does not fully prevent an attacker from
  328.      hijacking the connection, in the sense that it does not prevent
  329.      hijacking the connection between the initial authentication and the
  330.      `Gssapi-authenticate' request.
  331.  
  332. `Set VARIABLE=VALUE \n'
  333.      Response expected: no.  Set a user variable VARIABLE to VALUE.
  334.  
  335. `expand-modules \n'
  336.      Response expected: yes.  Expand the modules which are specified in
  337.      the arguments.  Returns the data in `Module-expansion' responses.
  338.      Note that the server can assume that this is checkout or export,
  339.      not rtag or rdiff; the latter do not access the working directory
  340.      and thus have no need to expand modules on the client side.
  341.  
  342.      Expand may not be the best word for what this request does.  It
  343.      does not necessarily tell you all the files contained in a module,
  344.      for example.  Basically it is a way of telling you which working
  345.      directories the server needs to know about in order to handle a
  346.      checkout of the specified modules.
  347.  
  348.      For example, suppose that the server has a module defined by
  349.  
  350.           aliasmodule -a 1dir
  351.  
  352.      That is, one can check out `aliasmodule' and it will take `1dir'
  353.      in the repository and check it out to `1dir' in the working
  354.      directory.  Now suppose the client already has this module checked
  355.      out and is planning on using the `co' request to update it.
  356.      Without using `expand-modules', the client would have two bad
  357.      choices: it could either send information about *all* working
  358.      directories under the current directory, which could be
  359.      unnecessarily slow, or it could be ignorant of the fact that
  360.      `aliasmodule' stands for `1dir', and neglect to send information
  361.      for `1dir', which would lead to incorrect operation.
  362.  
  363.      With `expand-modules', the client would first ask for the module to
  364.      be expanded:
  365.  
  366.           C: Root /home/kingdon/zwork/cvsroot
  367.           . . .
  368.           C: Argument aliasmodule
  369.           C: Directory .
  370.           C: /home/kingdon/zwork/cvsroot
  371.           C: expand-modules
  372.           S: Module-expansion 1dir
  373.           S: ok
  374.  
  375.      and then it knows to check the `1dir' directory and send requests
  376.      such as `Entry' and `Modified' for the files in that directory.
  377.  
  378. `ci \n'
  379. `diff \n'
  380. `tag \n'
  381. `status \n'
  382. `log \n'
  383. `admin \n'
  384. `history \n'
  385. `watchers \n'
  386. `editors \n'
  387. `annotate \n'
  388.      Response expected: yes.  Actually do a cvs command.  This uses any
  389.      previous `Argument', `Directory', `Entry', or `Modified' requests,
  390.      if they have been sent.  The last `Directory' sent specifies the
  391.      working directory at the time of the operation.  No provision is
  392.      made for any input from the user.  This means that `ci' must use a
  393.      `-m' argument if it wants to specify a log message.
  394.  
  395. `co \n'
  396.      Response expected: yes.  Get files from the repository.  This uses
  397.      any previous `Argument', `Directory', `Entry', or `Modified'
  398.      requests, if they have been sent.  Arguments to this command are
  399.      module names; the client cannot know what directories they
  400.      correspond to except by (1) just sending the `co' request, and then
  401.      seeing what directory names the server sends back in its
  402.      responses, and (2) the `expand-modules' request.
  403.  
  404. `export \n'
  405.      Response expected: yes.  Get files from the repository.  This uses
  406.      any previous `Argument', `Directory', `Entry', or `Modified'
  407.      requests, if they have been sent.  Arguments to this command are
  408.      module names, as described for the `co' request.  The intention
  409.      behind this command is that a client can get sources from a server
  410.      without storing CVS information about those sources.  That is, a
  411.      client probably should not count on being able to take the entries
  412.      line returned in the `Created' response from an `export' request
  413.      and send it in a future `Entry' request.  Note that the entries
  414.      line in the `Created' response must indicate whether the file is
  415.      binary or text, so the client can create it correctly.
  416.  
  417. `rdiff \n'
  418. `rtag \n'
  419.      Response expected: yes.  Actually do a cvs command.  This uses any
  420.      previous `Argument' requests, if they have been sent.  The client
  421.      should not send `Directory', `Entry', or `Modified' requests for
  422.      this command; they are not used.  Arguments to these commands are
  423.      module names, as described for `co'.
  424.  
  425. `init ROOT-NAME \n'
  426.      Response expected: yes.  If it doesn't already exist, create a CVS
  427.      repository ROOT-NAME.  Note that ROOT-NAME is a local directory
  428.      and *not* a fully qualified `CVSROOT' variable.  The `Root'
  429.      request need not have been previously sent.
  430.  
  431. `update \n'
  432.      Response expected: yes.  Actually do a `cvs update' command.  This
  433.      uses any previous `Argument', `Directory', `Entry', or `Modified'
  434.      requests, if they have been sent.  The last `Directory' sent
  435.      specifies the working directory at the time of the operation.  The
  436.      `-I' option is not used-files which the client can decide whether
  437.      to ignore are not mentioned and the client sends the
  438.      `Questionable' request for others.
  439.  
  440. `import \n'
  441.      Response expected: yes.  Actually do a `cvs import' command.  This
  442.      uses any previous `Argument', `Directory', `Entry', or `Modified'
  443.      requests, if they have been sent.  The last `Directory' sent
  444.      specifies the working directory at the time of the operation.  The
  445.      files to be imported are sent in `Modified' requests (files which
  446.      the client knows should be ignored are not sent; the server must
  447.      still process the CVSROOT/cvsignore file unless -I ! is sent).  A
  448.      log message must have been specified with a `-m' argument.
  449.  
  450. `add \n'
  451.      Response expected: yes.  Add a file or directory.  This uses any
  452.      previous `Argument', `Directory', `Entry', or `Modified' requests,
  453.      if they have been sent.  The last `Directory' sent specifies the
  454.      working directory at the time of the operation.
  455.  
  456.      To add a directory, send the directory to be added using
  457.      `Directory' and `Argument' requests.  For example:
  458.  
  459.           C: Root /u/cvsroot
  460.           . . .
  461.           C: Argument nsdir
  462.           C: Directory nsdir
  463.           C: /u/cvsroot/1dir/nsdir
  464.           C: Directory .
  465.           C: /u/cvsroot/1dir
  466.           C: add
  467.           S: M Directory /u/cvsroot/1dir/nsdir added to the repository
  468.           S: ok
  469.  
  470.      You will notice that the server does not signal to the client in
  471.      any particular way that the directory has been successfully added.
  472.      The client is supposed to just assume that the directory has been
  473.      added and update its records accordingly.  Note also that adding a
  474.      directory is immediate; it does not wait until a `ci' request as
  475.      files do.
  476.  
  477.      To add a file, send the file to be added using a `Modified'
  478.      request.  For example:
  479.  
  480.           C: Argument nfile
  481.           C: Directory .
  482.           C: /u/cvsroot/1dir
  483.           C: Modified nfile
  484.           C: u=rw,g=r,o=r
  485.           C: 6
  486.           C: hello
  487.           C: add
  488.           S: E cvs server: scheduling file `nfile' for addition
  489.           S: Mode u=rw,g=r,o=r
  490.           S: Checked-in ./
  491.           S: /u/cvsroot/1dir/nfile
  492.           S: /nfile/0///
  493.           S: E cvs server: use 'cvs commit' to add this file permanently
  494.           S: ok
  495.  
  496.      Note that the file has not been added to the repository; the only
  497.      effect of a successful `add' request, for a file, is to supply the
  498.      client with a new entries line containing `0' to indicate an added
  499.      file.  In fact, the client probably could perform this operation
  500.      without contacting the server, although using `add' does cause the
  501.      server to perform a few more checks.
  502.  
  503.      The client sends a subsequent `ci' to actually add the file to the
  504.      repository.
  505.  
  506.      Another quirk of the `add' request is that with CVS 1.9 and older,
  507.      a pathname specified in an `Argument' request cannot contain `/'.
  508.      There is no good reason for this restriction, and in fact more
  509.      recent CVS servers don't have it.  But the way to interoperate
  510.      with the older servers is to ensure that all `Directory' requests
  511.      for `add' (except those used to add directories, as described
  512.      above), use `.' for LOCAL-DIRECTORY.  Specifying another string for
  513.      LOCAL-DIRECTORY may not get an error, but it will get you strange
  514.      `Checked-in' responses from the buggy servers.
  515.  
  516. `remove \n'
  517.      Response expected: yes.  Remove a file.  This uses any previous
  518.      `Argument', `Directory', `Entry', or `Modified' requests, if they
  519.      have been sent.  The last `Directory' sent specifies the working
  520.      directory at the time of the operation.
  521.  
  522.      Note that this request does not actually do anything to the
  523.      repository; the only effect of a successful `remove' request is to
  524.      supply the client with a new entries line containing `-' to
  525.      indicate a removed file.  In fact, the client probably could
  526.      perform this operation without contacting the server, although
  527.      using `remove' may cause the server to perform a few more checks.
  528.  
  529.      The client sends a subsequent `ci' request to actually record the
  530.      removal in the repository.
  531.  
  532. `watch-on \n'
  533. `watch-off \n'
  534. `watch-add \n'
  535. `watch-remove \n'
  536.      Response expected: yes.  Actually do the `cvs watch on', `cvs
  537.      watch off', `cvs watch add', and `cvs watch remove' commands,
  538.      respectively.  This uses any previous `Argument', `Directory',
  539.      `Entry', or `Modified' requests, if they have been sent.  The last
  540.      `Directory' sent specifies the working directory at the time of
  541.      the operation.
  542.  
  543. `release \n'
  544.      Response expected: yes.  Note that a `cvs release' command has
  545.      taken place and update the history file accordingly.
  546.  
  547. `noop \n'
  548.      Response expected: yes.  This request is a null command in the
  549.      sense that it doesn't do anything, but merely (as with any other
  550.      requests expecting a response) sends back any responses pertaining
  551.      to pending errors, pending `Notified' responses, etc.
  552.  
  553. `update-patches \n'
  554.      Response expected: yes.  This request does not actually do
  555.      anything.  It is used as a signal that the server is able to
  556.      generate patches when given an `update' request.  The client must
  557.      issue the `-u' argument to `update' in order to receive patches.
  558.  
  559. `gzip-file-contents LEVEL \n'
  560.      Response expected: no.  Note that this request does not follow the
  561.      response convention stated above.  `Gzip-stream' is suggested
  562.      instead of `gzip-file-contents' as it gives better compression; the
  563.      only reason to implement the latter is to provide compression with
  564.      CVS 1.8 and earlier.  The `gzip-file-contents' request asks the
  565.      server to compress files it sends to the client using `gzip'
  566.      (RFC1952/1951) compression, using the specified level of
  567.      compression.  If this request is not made, the server must not
  568.      compress files.
  569.  
  570.      This is only a hint to the server.  It may still decide (for
  571.      example, in the case of very small files, or files that already
  572.      appear to be compressed) not to do the compression.  Compression
  573.      is indicated by a `z' preceding the file length.
  574.  
  575.      Availability of this request in the server indicates to the client
  576.      that it may compress files sent to the server, regardless of
  577.      whether the client actually uses this request.
  578.  
  579. `wrapper-sendme-rcsOptions \n'
  580.      Response expected: yes.  Request that the server transmit mappings
  581.      from filenames to keyword expansion modes in `Wrapper-rcsOption'
  582.      responses.
  583.  
  584. `OTHER-REQUEST TEXT \n'
  585.      Response expected: yes.  Any unrecognized request expects a
  586.      response, and does not contain any additional data.  The response
  587.      will normally be something like `error  unrecognized request', but
  588.      it could be a different error if a previous command which doesn't
  589.      expect a response produced an error.
  590.  
  591.    When the client is done, it drops the connection.
  592.  
  593. 
  594. File: cvsclient.info,  Node: Response intro,  Next: Response pathnames,  Prev: Requests,  Up: Protocol
  595.  
  596. Introduction to Responses
  597. =========================
  598.  
  599.    After a command which expects a response, the server sends however
  600. many of the following responses are appropriate.  The server should not
  601. send data at other times (the current implementation may violate this
  602. principle in a few minor places, where the server is printing an error
  603. message and exiting--this should be investigated further).
  604.  
  605.    Any set of responses always ends with `error' or `ok'.  This
  606. indicates that the response is over.
  607.  
  608.    The responses `Checked-in', `New-entry', `Updated', `Created',
  609. `Update-existing', `Merged', and `Patched' are refered to as "file
  610. updating" responses, because they change the status of a file in the
  611. working directory in some way.  The responses `Mode', `Mod-time', and
  612. `Checksum' are referred to as "file update modifying" responses because
  613. they modify the next file updating response.  In no case shall a file
  614. update modifying response apply to a file updating response other than
  615. the next one.  Nor can the same file update modifying response occur
  616. twice for a given file updating response (if servers diagnose this
  617. problem, it may aid in detecting the case where clients send an update
  618. modifying response without following it by a file updating response).
  619.  
  620. 
  621. File: cvsclient.info,  Node: Response pathnames,  Next: Responses,  Prev: Response intro,  Up: Protocol
  622.  
  623. The "pathname" in responses
  624. ===========================
  625.  
  626.    Many of the responses contain something called PATHNAME.  The name
  627. is somewhat misleading; it actually indicates a pair of pathnames.
  628. First, a local directory name relative to the directory in which the
  629. command was given (i.e. the last `Directory' before the command).  Then
  630. a linefeed and a repository name.  Then a slash and the filename
  631. (without a `,v' ending).  For example, for a file `i386.mh' which is in
  632. the local directory `gas.clean/config' and for which the repository is
  633. `/rel/cvsfiles/devo/gas/config':
  634.  
  635.      gas.clean/config/
  636.      /rel/cvsfiles/devo/gas/config/i386.mh
  637.  
  638.    If the server wants to tell the client to create a directory, then it
  639. merely uses the directory in any response, as described above, and the
  640. client should create the directory if it does not exist.  Note that this
  641. should only be done one directory at a time, in order to permit the
  642. client to correctly store the repository for each directory.  Servers
  643. can use requests such as `Clear-sticky', `Clear-static-directory', or
  644. any other requests, to create directories.
  645.  
  646.    Some server implementations may poorly distinguish between a
  647. directory which should not exist and a directory which contains no
  648. files; in order to refrain from creating empty directories a client
  649. should both send the `-P' option to `update' or `co', and should also
  650. detect the case in which the server asks to create a directory but not
  651. any files within it (in that case the client should remove the
  652. directory or refrain from creating it in the first place).  Note that
  653. servers could clean this up greatly by only telling the client to
  654. create directories if the directory in question should exist, but until
  655. servers do this, clients will need to offer the `-P' behavior described
  656. above.
  657.  
  658. 
  659. File: cvsclient.info,  Node: Responses,  Next: Text tags,  Prev: Response pathnames,  Up: Protocol
  660.  
  661. Responses
  662. =========
  663.  
  664.    Here are the responses:
  665.  
  666. `Valid-requests REQUEST-LIST \n'
  667.      Indicate what requests the server will accept.  REQUEST-LIST is a
  668.      space separated list of tokens.  If the server supports sending
  669.      patches, it will include `update-patches' in this list.  The
  670.      `update-patches' request does not actually do anything.
  671.  
  672. `Checked-in PATHNAME \n'
  673.      Additional data: New Entries line, \n.  This means a file PATHNAME
  674.      has been successfully operated on (checked in, added, etc.).  name
  675.      in the Entries line is the same as the last component of PATHNAME.
  676.  
  677. `New-entry PATHNAME \n'
  678.      Additional data: New Entries line, \n.  Like `Checked-in', but the
  679.      file is not up to date.
  680.  
  681. `Updated PATHNAME \n'
  682.      Additional data: New Entries line, \n, mode, \n, file
  683.      transmission.  A new copy of the file is enclosed.  This is used
  684.      for a new revision of an existing file, or for a new file, or for
  685.      any other case in which the local (client-side) copy of the file
  686.      needs to be updated, and after being updated it will be up to
  687.      date.  If any directory in pathname does not exist, create it.
  688.      This response is not used if `Created' and `Update-existing' are
  689.      supported.
  690.  
  691. `Created PATHNAME \n'
  692.      This is just like `Updated' and takes the same additional data, but
  693.      is used only if no `Entry', `Modified', or `Unchanged' request has
  694.      been sent for the file in question.  The distinction between
  695.      `Created' and `Update-existing' is so that the client can give an
  696.      error message in several cases: (1) there is a file in the working
  697.      directory, but not one for which `Entry', `Modified', or
  698.      `Unchanged' was sent (for example, a file which was ignored, or a
  699.      file for which `Questionable' was sent), (2) there is a file in
  700.      the working directory whose name differs from the one mentioned in
  701.      `Created' in ways that the client is unable to use to distinguish
  702.      files.  For example, the client is case-insensitive and the names
  703.      differ only in case.
  704.  
  705. `Update-existing PATHNAME \n'
  706.      This is just like `Updated' and takes the same additional data, but
  707.      is used only if a `Entry', `Modified', or `Unchanged' request has
  708.      been sent for the file in question.
  709.  
  710.      This response, or `Merged', indicates that the server has
  711.      determined that it is OK to overwrite the previous contents of the
  712.      file specified by PATHNAME.  Provided that the client has correctly
  713.      sent `Modified' or `Is-modified' requests for a modified file, and
  714.      the file was not modified while CVS was running, the server can
  715.      ensure that a user's modifications are not lost.
  716.  
  717. `Merged PATHNAME \n'
  718.      This is just like `Updated' and takes the same additional data,
  719.      with the one difference that after the new copy of the file is
  720.      enclosed, it will still not be up to date.  Used for the results
  721.      of a merge, with or without conflicts.
  722.  
  723.      It is useful to preserve an copy of what the file looked like
  724.      before the merge.  This is basically handled by the server; before
  725.      sending `Merged' it will send a `Copy-file' response.  For
  726.      example, if the file is `aa' and it derives from revision 1.3, the
  727.      `Copy-file' response will tell the client to copy `aa' to
  728.      `.#aa.1.3'.  It is up to the client to decide how long to keep this
  729.      file around; traditionally clients have left it around forever,
  730.      thus letting the user clean it up as desired.  But another answer,
  731.      such as until the next commit, might be preferable.
  732.  
  733. `Rcs-diff PATHNAME \n'
  734.      This is just like `Updated' and takes the same additional data,
  735.      with the one difference that instead of sending a new copy of the
  736.      file, the server sends an RCS change text.  This change text is
  737.      produced by `diff -n' (the GNU diff `-a' option may also be used).
  738.      The client must apply this change text to the existing file.
  739.      This will only be used when the client has an exact copy of an
  740.      earlier revision of a file.  This response is only used if the
  741.      `update' command is given the `-u' argument.
  742.  
  743. `Patched PATHNAME \n'
  744.      This is just like `Rcs-diff' and takes the same additional data,
  745.      except that it sends a standard patch rather than an RCS change
  746.      text.  The patch is produced by `diff -c' for CVS 1.6 and later
  747.      (see POSIX.2 for a description of this format), or `diff -u' for
  748.      previous versions of CVS; clients are encouraged to accept either
  749.      format.  Like `Rcs-diff', this response is only used if the
  750.      `update' command is given the `-u' argument.
  751.  
  752.      The `Patched' response is deprecated in favor of the `Rcs-diff'
  753.      response.  However, older clients (CVS 1.9 and earlier) only
  754.      support `Patched'.
  755.  
  756. `Mode MODE \n'
  757.      This MODE applies to the next file mentioned in `Checked-in'.
  758.      `Mode' is a file update modifying response as described in *Note
  759.      Response intro::.
  760.  
  761. `Mod-time TIME \n'
  762.      Set the modification time of the next file sent to TIME.
  763.      `Mod-time' is a file update modifying response as described in
  764.      *Note Response intro::.  The TIME is in the format specified by
  765.      RFC822 as modified by RFC1123.  The server may specify any
  766.      timezone it chooses; clients will want to convert that to their
  767.      own timezone as appropriate.  An example of this format is:
  768.  
  769.           26 May 1997 13:01:40 -0400
  770.  
  771.      There is no requirement that the client and server clocks be
  772.      synchronized.  The server just sends its recommendation for a
  773.      timestamp (based on its own clock, presumably), and the client
  774.      should just believe it (this means that the time might be in the
  775.      future, for example).
  776.  
  777. `Checksum CHECKSUM\n'
  778.      The CHECKSUM applies to the next file sent (that is, `Checksum' is
  779.      a file update modifying response as described in *Note Response
  780.      intro::).  In the case of `Patched', the checksum applies to the
  781.      file after being patched, not to the patch itself.  The client
  782.      should compute the checksum itself, after receiving the file or
  783.      patch, and signal an error if the checksums do not match.  The
  784.      checksum is the 128 bit MD5 checksum represented as 32 hex digits
  785.      (MD5 is described in RFC1321).  This response is optional, and is
  786.      only used if the client supports it (as judged by the
  787.      `Valid-responses' request).
  788.  
  789. `Copy-file PATHNAME \n'
  790.      Additional data: NEWNAME \n.  Copy file PATHNAME to NEWNAME in the
  791.      same directory where it already is.  This does not affect
  792.      `CVS/Entries'.
  793.  
  794.      This can optionally be implemented as a rename instead of a copy.
  795.      The only use for it which currently has been identified is prior
  796.      to a `Merged' response as described under `Merged'.  Clients can
  797.      probably assume that is how it is being used, if they want to worry
  798.      about things like how long to keep the NEWNAME file around.
  799.  
  800. `Removed PATHNAME \n'
  801.      The file has been removed from the repository (this is the case
  802.      where cvs prints `file foobar.c is no longer pertinent').
  803.  
  804. `Remove-entry PATHNAME \n'
  805.      The file needs its entry removed from `CVS/Entries', but the file
  806.      itself is already gone (this happens in response to a `ci' request
  807.      which involves committing the removal of a file).
  808.  
  809. `Set-static-directory PATHNAME \n'
  810.      This instructs the client to set the `Entries.Static' flag, which
  811.      it should then send back to the server in a `Static-directory'
  812.      request whenever the directory is operated on.  PATHNAME ends in a
  813.      slash; its purpose is to specify a directory, not a file within a
  814.      directory.
  815.  
  816. `Clear-static-directory PATHNAME \n'
  817.      Like `Set-static-directory', but clear, not set, the flag.
  818.  
  819. `Set-sticky PATHNAME \n'
  820.      Additional data: TAGSPEC \n.  Tell the client to set a sticky tag
  821.      or date, which should be supplied with the `Sticky' request for
  822.      future operations.  PATHNAME ends in a slash; its purpose is to
  823.      specify a directory, not a file within a directory.  The client
  824.      should store TAGSPEC and pass it back to the server as-is, to
  825.      allow for future expansion.  The first character of TAGSPEC is `T'
  826.      for a tag, `D' for a date, or something else for future expansion.
  827.      The remainder of TAGSPEC contains the actual tag or date.
  828.  
  829. `Clear-sticky PATHNAME \n'
  830.      Clear any sticky tag or date set by `Set-sticky'.
  831.  
  832. `Template PATHNAME \n'
  833.      Additional data: file transmission (note: compressed file
  834.      transmissions are not supported).  PATHNAME ends in a slash; its
  835.      purpose is to specify a directory, not a file within a directory.
  836.      Tell the client to store the file transmission as the template log
  837.      message, and then use that template in the future when prompting
  838.      the user for a log message.
  839.  
  840. `Set-checkin-prog DIR \n'
  841.      Additional data: PROG \n.  Tell the client to set a checkin
  842.      program, which should be supplied with the `Checkin-prog' request
  843.      for future operations.
  844.  
  845. `Set-update-prog DIR \n'
  846.      Additional data: PROG \n.  Tell the client to set an update
  847.      program, which should be supplied with the `Update-prog' request
  848.      for future operations.
  849.  
  850. `Notified PATHNAME \n'
  851.      Indicate to the client that the notification for PATHNAME has been
  852.      done.  There should be one such response for every `Notify'
  853.      request; if there are several `Notify' requests for a single file,
  854.      the requests should be processed in order; the first `Notified'
  855.      response pertains to the first `Notify' request, etc.
  856.  
  857. `Module-expansion PATHNAME \n'
  858.      Return a file or directory which is included in a particular
  859.      module.  PATHNAME is relative to cvsroot, unlike most pathnames in
  860.      responses.  PATHNAME should be used to look and see whether some
  861.      or all of the module exists on the client side; it is not
  862.      necessarily suitable for passing as an argument to a `co' request
  863.      (for example, if the modules file contains the `-d' option, it
  864.      will be the directory specified with `-d', not the name of the
  865.      module).
  866.  
  867. `Wrapper-rcsOption PATTERN -k 'OPTION' \n'
  868.      Transmit to the client a filename pattern which implies a certain
  869.      keyword expansion mode.  The PATTERN is a wildcard pattern (for
  870.      example, `*.exe'.  The OPTION is `b' for binary, and so on.  Note
  871.      that although the syntax happens to resemble the syntax in certain
  872.      CVS configuration files, it is more constrained; there must be
  873.      exactly one space between PATTERN and `-k' and exactly one space
  874.      between `-k' and `'', and no string is permitted in place of `-k'
  875.      (extensions should be done with new responses, not by extending
  876.      this one, for graceful handling of `Valid-responses').
  877.  
  878. `M TEXT \n'
  879.      A one-line message for the user.
  880.  
  881. `Mbinary \n'
  882.      Additional data: file transmission (note: compressed file
  883.      transmissions are not supported).  This is like `M', except the
  884.      contents of the file transmission are binary and should be copied
  885.      to standard output without translation to local text file
  886.      conventions.  To transmit a text file to standard output, servers
  887.      should use a series of `M' requests.
  888.  
  889. `E TEXT \n'
  890.      Same as `M' but send to stderr not stdout.
  891.  
  892. `F \n'
  893.      Flush stderr.  That is, make it possible for the user to see what
  894.      has been written to stderr (it is up to the implementation to
  895.      decide exactly how far it should go to ensure this).
  896.  
  897. `MT TAGNAME DATA \n'
  898.      This response provides for tagged text.  It is similar to
  899.      SGML/HTML/XML in that the data is structured and a naive
  900.      application can also make some sense of it without understanding
  901.      the structure.  The syntax is not SGML-like, however, in order to
  902.      fit into the CVS protocol better and (more importantly) to make it
  903.      easier to parse, especially in a language like perl or awk.
  904.  
  905.      The TAGNAME can have several forms.  If it starts with `a' to `z'
  906.      or `A' to `Z', then it represents tagged text.  If the
  907.      implementation recognizes TAGNAME, then it may interpret DATA in
  908.      some particular fashion.  If the implementation does not recognize
  909.      TAGNAME, then it should simply treat DATA as text to be sent to
  910.      the user (similar to an `M' response).  There are two tags which
  911.      are general purpose.  The `text' tag is similar to an unrecognized
  912.      tag in that it provides text which will ordinarily be sent to the
  913.      user.  The `newline' tag is used without DATA and indicates that a
  914.      newline will ordinarily be sent to the user (there is no provision
  915.      for embedding newlines in the DATA of other tagged text responses).
  916.  
  917.      If TAGNAME starts with `+' it indicates a start tag and if it
  918.      starts with `-' it indicates an end tag.  The remainder of TAGNAME
  919.      should be the same for matching start and end tags, and tags
  920.      should be nested (for example one could have tags in the following
  921.      order `+bold' `+italic' `text' `-italic' `-bold' but not `+bold'
  922.      `+italic' `text' `-bold' `-italic').  A particular start and end
  923.      tag may be documented to constrain the tagged text responses which
  924.      are valid between them.
  925.  
  926.      Note that if DATA is present there will always be exactly one
  927.      space between TAGNAME and DATA; if there is more than one space,
  928.      then the spaces beyond the first are part of DATA.
  929.  
  930.      Here is an example of some tagged text responses.  Note that there
  931.      is a trailing space after `Checking in' and `initial revision:'
  932.      and there are two trailing spaces after `<--'.  Such trailing
  933.      spaces are, of course, part of DATA.
  934.  
  935.           MT +checking-in
  936.           MT text Checking in
  937.           MT fname gz.tst
  938.           MT text ;
  939.           MT newline
  940.           MT rcsfile /home/kingdon/zwork/cvsroot/foo/gz.tst,v
  941.           MT text   <--
  942.           MT fname gz.tst
  943.           MT newline
  944.           MT text initial revision:
  945.           MT init-rev 1.1
  946.           MT newline
  947.           MT text done
  948.           MT newline
  949.           MT -checking-in
  950.  
  951.      If the client does not support the `MT' response, the same
  952.      responses might be sent as:
  953.  
  954.           M Checking in gz.tst;
  955.           M /home/kingdon/zwork/cvsroot/foo/gz.tst,v  <--  gz.tst
  956.           M initial revision: 1.1
  957.           M done
  958.  
  959.      For a list of specific tags, see *Note Text tags::.
  960.  
  961. `error ERRNO-CODE ` ' TEXT \n'
  962.      The command completed with an error.  ERRNO-CODE is a symbolic
  963.      error code (e.g. `ENOENT'); if the server doesn't support this
  964.      feature, or if it's not appropriate for this particular message,
  965.      it just omits the errno-code (in that case there are two spaces
  966.      after `error').  Text is an error message such as that provided by
  967.      strerror(), or any other message the server wants to use.
  968.  
  969. `ok \n'
  970.      The command completed successfully.
  971.  
  972. 
  973. File: cvsclient.info,  Node: Text tags,  Next: Example,  Prev: Responses,  Up: Protocol
  974.  
  975. Tags for the MT tagged text response
  976. ====================================
  977.  
  978.    The `MT' response, as described in *Note Responses::, offers a way
  979. for the server to send tagged text to the client.  This section
  980. describes specific tags.  The intention is to update this section as
  981. servers add new tags.
  982.  
  983.    In the following descriptions, `text' and `newline' tags are
  984. omitted.  Such tags contain information which is intended for users (or
  985. to be discarded), and are subject to change at the whim of the server.
  986. To avoid being vulnerable to such whim, clients should look for the tags
  987. listed here, not `text', `newline', or other tags.
  988.  
  989.    The following tag means to indicate to the user that a file has been
  990. updated.  It is more or less redundant with the `Created' and
  991. `Update-existing' responses, but we don't try to specify here whether
  992. it occurs in exactly the same circumstances as `Created' and
  993. `Update-existing'.  The NAME is the pathname of the file being updated
  994. relative to the directory in which the command is occurring (that is,
  995. the last `Directory' request which is sent before the command).
  996.  
  997.      MT +updated
  998.      MT fname NAME
  999.      MT -updated
  1000.  
  1001.